import React, { Component } from 'react'

export default class App extends Component {
    state={
        myname:'asf'
    }
  render() {
    return (
      <div>
          <h1>登录页</h1>
          {/* <input type="text" ref={this.myuname} /> */}
          <input type="text"  value={this.state.myname} onChange={(e)=>{
              console.log('change',e.target.value) 
          this.setState({myname:e.target.value})}}/>
          <button onClick={()=>{console.log(this.state.myname)}}>login</button>
          <button onClick={()=>{this.setState({myname:''})}}>reset</button>
      </div>
    )
  }
}
